import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    name: 'layout',
    component:  () => import('@/Layout/index.vue'),
    children: [
        {
            path: '/ProductCategory',
            name: 'ProductCategory',
            component:  () => import('@/views/Category/index.vue'),
        },
        {
            path: '/ProductCategory/Save/:id?',
            name: 'ProductCategorySave',
            component:  () => import('@/views/Category/Save.vue'),
        },
        // 大区
        {
            path: '/ProductArea',
            name: 'ProductArea',
            component:  () => import('@/views/Area/index.vue'),
        },
        {
            path: '/ProductArea/Save/:id?',
            name: 'ProductAreaSave',
            component:  () => import('@/views/Area/Save.vue'),
        },
        // ProductCondition
        {
            path: '/ProductCondition',
            name: 'ProductCondition',
            component:  () => import('@/views/Condition/index.vue'),
        },
        {
            path: '/ProductCondition/Save/:id?',
            name: 'ProductConditionSave',
            component:  () => import('@/views/Condition/Save.vue'),
        },
        {
            path: '/ProductServer',
            name: 'ProductServer',
            component:  () => import('@/views/Server/index.vue'),
        },
        {
            path: '/ProductServer/Save/:id?',
            name: 'ProductServerSave',
            component:  () => import('@/views/Server/Save.vue'),
        },
        // 产品tag
        {
            path: '/ProductTag',
            name: 'ProductTag',
            component:  () => import('@/views/Tag/index.vue'),
        },
        {
            path: '/ProductTag/Save/:id?',
            name: 'ProductTagSave',
            component:  () => import('@/views/Tag/Save.vue'),
        },
        {
            path: '/ProductList',
            name: 'ProductList',
            component:  () => import('@/views/Goods/index.vue'),
        },
        {
            path: '/ProductList/Save/:id?',
            name: 'ProductListSave',
            component:  () => import('@/views/Goods/Save.vue'),
        },
        {
            name: 'role',
            path: '/role',
            component:  () => import('@/views/role/index.vue'),
        },
        {
            name: 'roleSave',
            path: '/role/Save/:id?',
            component:  () => import('@/views/role/Save.vue'),
        },
        {
            name: 'user',
            path: '/user',
            component:  () => import('@/views/user/index.vue'),
        },
        {
            name: 'userSave',
            path: '/user/Save/:id?',
            component:  () => import('@/views/user/Save.vue'),
        },
    ]
  },
    {
        path: '/login',
        name: 'login',
        component:  () => import('@/views/Login.vue'),
    }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
